/*
 * Copyright(C) 2010 the original author or authors.
 *
 * Change History Log
 * ----------------------------------------------------
 * Version: 1.0
 * Date: 2011-5-22
 * Author: wangzl
 * ----------------------------------------------------
 */
package com.seemsea.service.impl.admin;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.seemsea.dao.admin.CouponDao;
import com.seemsea.entity.admin.coupon.Coupon;
import com.seemsea.entity.admin.coupon.Product;
import com.seemsea.service.admin.CouponService;

/**
 * 
 * 
 * @author wangzl
 * @since 2011-5-22
 */
@Service
@Transactional(readOnly = false)
public class CouponServiceImpl implements CouponService{

	@Autowired
	private CouponDao couponDao;
	
	public void operateCoupon(Coupon coupon) {
		couponDao.save(coupon);
	}

	public Coupon get(String code) {
		return couponDao.get(code);
	}

	public List<Coupon> getAll() {
		return couponDao.getAll();
	}

	public List<Coupon> getCouponByProduct(Product product) {
		return couponDao.getCouponByProduct(product);
	}
}
